<template>
  <div>
    <el-popover>
      <el-input slot="reference" :value="value"></el-input>
      <div>
        <el-tree
          :data="tree"
          node-key="id"
          :props="orgProps"
          @node-click="handleNodeClick"></el-tree>
      </div>
    </el-popover>
  </div>
</template>
<script>
export default {
  data() {
    return {
      orgProps: {
        label: 'name'
      }
    }
  },
  props: {
    tree: Array,
    value: String
  },
  methods: {
    handleNodeClick(data) {
      this.$emit('node-click',data)
    }
  }
}
</script>
